import Vue from 'vue'
import VueRouter from 'vue-router'
import layout from '@/layout/index.vue'
Vue.use(VueRouter)

/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    role: ['admin','editor']    control the page role (you can set multiple role)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar
    noCache: true                if set true, the page will no be cached(default is false)
    affix: true                  if set true, the tag will affix in the tags-view
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */

export const routes = [{
  path: '/',
  component: layout,
  redirect: '/stagger',
  children: [{
    path: 'stagger',
    component: () => import('@/views/stagger/index'),
    name: 'stagger',
    meta: {
      title: '交错动画',
      affix: true
    }
  }, {
    path: 'dividetxt',
    component: () => import('@/views/divide/index'),
    name: 'dividetxt',
    meta: {
      title: '切割文本'
    }
  }, {
    // path: 'snow/:id',
    path: 'snow',
    component: () => import('@/views/snow/index'),
    name: 'snow',
    meta: {
      title: '粒子群'
    }
  }, {
    path: 'pseudo',
    component: () => import('@/views/pseudo/index'),
    name: 'pseudo',
    meta: {
      title: '伪类'
    }
  }, {
    path: 'overhidden',
    component: () => import('@/views/overhidden/index'),
    name: 'overhidden',
    meta: {
      title: '障眼法'
    }
  }, {
    path: 'border',
    component: () => import('@/views/border/index'),
    name: 'border',
    meta: {
      title: '边框'
    }
  }, {
    path: 'pagination',
    component: () => import('@/views/pagination/index'),
    name: 'pagination',
    meta: {
      title: '分页'
    }
  }, {
    path: 'boxshadow',
    component: () => import('@/views/boxshadow/index'),
    name: 'boxshadow',
    meta: {
      title: '阴影'
    }
  }, {
    path: 'text',
    component: () => import('@/views/text/index'),
    name: 'text',
    meta: {
      title: '花样文本'
    }
  }, {
    path: 'gradient',
    component: () => import('@/views/gradient/index'),
    name: 'gradient',
    meta: {
      title: '渐变'
    }
  }, {
    path: 'light',
    component: () => import('@/views/light/index'),
    name: 'light',
    meta: {
      title: '点亮武汉'
    }
  }, {
    path: 'filter',
    component: () => import('@/views/filter/index'),
    name: 'filter',
    meta: {
      title: '滤镜'
    }
  }]
},
{
  path: '/404',
  component: () => import('@/views/error/404'),
  name: '404',
  hidden: true
},
{
  path: '*',
  redirect: '/404',
  hidden: true
}]
var router = new VueRouter({
  routes: routes
})
export default router
